<template>
  <div class="mainpart">
    <div class="loginbox">
      <i class="logo"></i>
      <div class="title">
        <div class="title-img"></div>
        <div class="online_reporting_text"></div>
      </div>
      <div class="content">
        这是一个测试页面
      </div>
    </div>
  </div>
</template> 

<script>
export default {
  name: "index",
  // metaInfo: {
  //   title: "这是页面标题",
  //   meta: [
  //     {
  //       name: "keywords",
  //       content: "关键字1,关键字2,关键字3"
  //     },
  //     {
  //       name: "description",
  //       content: "这是一段网页的描述"
  //     }
  //   ]
  // },
  //下面是异步加载seo
  metaInfo() {
    return this.page_obj;
  },
  data() {
    return {
      page_obj: {
        title: "加载中"
      }
    };
  },
  created() {
    this.get_pageSyset();
  },
  methods: {
    get_pageSyset() {
      //这里就使用setTimeout 模拟ajax了
      setTimeout(() => {
        this.page_obj= {
          title: "程序之家首页",
          meta: [
            {
              name: "keywords",
              content: "关键字1,关键字2,关键字3"
            },
            {
              name: "description",
              content: "这是一段网页的描述"
            }
          ]
        };

      }, 1000);
    }
  }
};
</script> 
 

<style lang="stylus" scoped></style>
